import React, {PureComponent} from 'react'
import propTypes from 'prop-types'

class Loading extends PureComponent {
  render() {
    const {className, title} = this.props

    return (
      <div
        className={'flex-row justify-center align-center' + (className ? ` ${className}` : '')}
        style={{
          padding: '5px 0'
        }}
      >
        <span
          style={{
            margin: '0 0 0 3px'
          }}
        >{title}</span>
      </div>
    )
  }
}

Loading.propsTypes = {
  className: propTypes.string,
  title: propTypes.string
}

Loading.defaultProps = {
  title: '加载中...'
}

export default Loading
